<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>embedme: TcpSocket类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.8 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="hierarchy.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="class_tcp_socket-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">TcpSocket类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>TcpSocket类  
 <a href="class_tcp_socket.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="_socket_8h_source.html">Socket.h</a>&gt;</code></p>
<div class="dynheader">
类 TcpSocket 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_tcp_socket.png" usemap="#TcpSocket_map" alt=""/>
  <map id="TcpSocket_map" name="TcpSocket_map">
<area href="class_socket.html" title="Socket抽象基类 " alt="Socket" shape="rect" coords="0,56,71,80"/>
<area href="class_i_o_device.html" title="IO设备抽象类 " alt="IODevice" shape="rect" coords="0,0,71,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a5e0e69092165d6847478a27006b8a8c6"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tcp_socket.html#a5e0e69092165d6847478a27006b8a8c6">open</a> ()</td></tr>
<tr class="memdesc:a5e0e69092165d6847478a27006b8a8c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">打开TCP socket  <a href="#a5e0e69092165d6847478a27006b8a8c6">更多...</a><br /></td></tr>
<tr class="separator:a5e0e69092165d6847478a27006b8a8c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58d2fff73fb69eb3f18b00aca7d6c87a"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tcp_socket.html#a58d2fff73fb69eb3f18b00aca7d6c87a">close</a> ()</td></tr>
<tr class="memdesc:a58d2fff73fb69eb3f18b00aca7d6c87a"><td class="mdescLeft">&#160;</td><td class="mdescRight">关闭TCP socket  <a href="#a58d2fff73fb69eb3f18b00aca7d6c87a">更多...</a><br /></td></tr>
<tr class="separator:a58d2fff73fb69eb3f18b00aca7d6c87a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35fb1c8b1f5235bce6418a75252c136e"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tcp_socket.html#a35fb1c8b1f5235bce6418a75252c136e">readData</a> (char *buf, sint32 len, sint32 timeoutMs=-1)</td></tr>
<tr class="memdesc:a35fb1c8b1f5235bce6418a75252c136e"><td class="mdescLeft">&#160;</td><td class="mdescRight">TCP socket接收数据  <a href="#a35fb1c8b1f5235bce6418a75252c136e">更多...</a><br /></td></tr>
<tr class="separator:a35fb1c8b1f5235bce6418a75252c136e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f7504d2465e529139750cd36f794822"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tcp_socket.html#a5f7504d2465e529139750cd36f794822">writeData</a> (const char *buf, sint32 len, sint32 timeoutMs=-1)</td></tr>
<tr class="memdesc:a5f7504d2465e529139750cd36f794822"><td class="mdescLeft">&#160;</td><td class="mdescRight">TCP socket发送数据  <a href="#a5f7504d2465e529139750cd36f794822">更多...</a><br /></td></tr>
<tr class="separator:a5f7504d2465e529139750cd36f794822"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5aa820cc351f24dada219b243e832bc0"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tcp_socket.html#a5aa820cc351f24dada219b243e832bc0">listenConnection</a> (sint32 maxpend)</td></tr>
<tr class="memdesc:a5aa820cc351f24dada219b243e832bc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">TCP socket监听连接  <a href="#a5aa820cc351f24dada219b243e832bc0">更多...</a><br /></td></tr>
<tr class="separator:a5aa820cc351f24dada219b243e832bc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a126ef6e4d23288de68432af73ec46cb1"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tcp_socket.html#a126ef6e4d23288de68432af73ec46cb1">acceptConnection</a> (<a class="el" href="class_tcp_socket.html">TcpSocket</a> &amp;newSocket)</td></tr>
<tr class="memdesc:a126ef6e4d23288de68432af73ec46cb1"><td class="mdescLeft">&#160;</td><td class="mdescRight">TCP socket接受连接  <a href="#a126ef6e4d23288de68432af73ec46cb1">更多...</a><br /></td></tr>
<tr class="separator:a126ef6e4d23288de68432af73ec46cb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5470902009a68d3fd66c924eb33a6737"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tcp_socket.html#a5470902009a68d3fd66c924eb33a6737">connectToHost</a> (uint16 peerPort, std::string peerAddr)</td></tr>
<tr class="memdesc:a5470902009a68d3fd66c924eb33a6737"><td class="mdescLeft">&#160;</td><td class="mdescRight">TCP socket连接远端  <a href="#a5470902009a68d3fd66c924eb33a6737">更多...</a><br /></td></tr>
<tr class="separator:a5470902009a68d3fd66c924eb33a6737"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_socket"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_socket')"><img src="closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="class_socket.html">Socket</a></td></tr>
<tr class="memitem:ae648df0cc1da2ad17f4bc65d396d2b71 inherit pub_methods_class_socket"><td class="memItemLeft" align="right" valign="top">virtual sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_socket.html#ae648df0cc1da2ad17f4bc65d396d2b71">bind</a> (uint16 localPort, std::string localAddr=&quot;&quot;)</td></tr>
<tr class="memdesc:ae648df0cc1da2ad17f4bc65d396d2b71 inherit pub_methods_class_socket"><td class="mdescLeft">&#160;</td><td class="mdescRight">绑定socket到指定IP地址的端口上  <a href="#ae648df0cc1da2ad17f4bc65d396d2b71">更多...</a><br /></td></tr>
<tr class="separator:ae648df0cc1da2ad17f4bc65d396d2b71 inherit pub_methods_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac11b26f96b7482cce8290d906a692b9 inherit pub_methods_class_socket"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aac11b26f96b7482cce8290d906a692b9"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><b>getLocalAddr</b> ()</td></tr>
<tr class="separator:aac11b26f96b7482cce8290d906a692b9 inherit pub_methods_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89b9de5a3e5e81bf5fdcb94989565a72 inherit pub_methods_class_socket"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a89b9de5a3e5e81bf5fdcb94989565a72"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><b>getPeerAddr</b> ()</td></tr>
<tr class="separator:a89b9de5a3e5e81bf5fdcb94989565a72 inherit pub_methods_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e4c158afc1b2cefc43609c1c0622088 inherit pub_methods_class_socket"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8e4c158afc1b2cefc43609c1c0622088"></a>
sint32&#160;</td><td class="memItemRight" valign="bottom"><b>getLocalPort</b> ()</td></tr>
<tr class="separator:a8e4c158afc1b2cefc43609c1c0622088 inherit pub_methods_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac75c2e8b397efe26f53b9ef541dee98f inherit pub_methods_class_socket"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac75c2e8b397efe26f53b9ef541dee98f"></a>
sint32&#160;</td><td class="memItemRight" valign="bottom"><b>getPeerPort</b> ()</td></tr>
<tr class="separator:ac75c2e8b397efe26f53b9ef541dee98f inherit pub_methods_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9e3b0239157c8c1fb5a881b22f6e4cb inherit pub_methods_class_socket"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_socket.html#aa9e3b0239157c8c1fb5a881b22f6e4cb">isAlive</a> ()</td></tr>
<tr class="memdesc:aa9e3b0239157c8c1fb5a881b22f6e4cb inherit pub_methods_class_socket"><td class="mdescLeft">&#160;</td><td class="mdescRight">检查socket是否已打开  <a href="#aa9e3b0239157c8c1fb5a881b22f6e4cb">更多...</a><br /></td></tr>
<tr class="separator:aa9e3b0239157c8c1fb5a881b22f6e4cb inherit pub_methods_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9a5eeed90596d23629a4d7777696575 inherit pub_methods_class_socket"><td class="memItemLeft" align="right" valign="top">virtual sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_socket.html#af9a5eeed90596d23629a4d7777696575">open</a> (const char *device, sint32 ioMode)</td></tr>
<tr class="memdesc:af9a5eeed90596d23629a4d7777696575 inherit pub_methods_class_socket"><td class="mdescLeft">&#160;</td><td class="mdescRight">打开设备  <a href="#af9a5eeed90596d23629a4d7777696575">更多...</a><br /></td></tr>
<tr class="separator:af9a5eeed90596d23629a4d7777696575 inherit pub_methods_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae40a3069ac1e266adb1c4e9575190d49 inherit pub_methods_class_socket"><td class="memItemLeft" align="right" valign="top">virtual sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_socket.html#ae40a3069ac1e266adb1c4e9575190d49">setAttribute</a> (sint32 attr, sint32 value)</td></tr>
<tr class="memdesc:ae40a3069ac1e266adb1c4e9575190d49 inherit pub_methods_class_socket"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置socket类型  <a href="#ae40a3069ac1e266adb1c4e9575190d49">更多...</a><br /></td></tr>
<tr class="separator:ae40a3069ac1e266adb1c4e9575190d49 inherit pub_methods_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe297c65236efc74fdadb399f7081fc9 inherit pub_methods_class_socket"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afe297c65236efc74fdadb399f7081fc9"></a>
virtual sint32&#160;</td><td class="memItemRight" valign="bottom"><b>getAttribute</b> (sint32 attr)</td></tr>
<tr class="separator:afe297c65236efc74fdadb399f7081fc9 inherit pub_methods_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
额外继承的成员函数</h2></td></tr>
<tr class="inherit_header pro_attribs_class_socket"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_class_socket')"><img src="closed.png" alt="-"/>&#160;Protected 属性 继承自 <a class="el" href="class_socket.html">Socket</a></td></tr>
<tr class="memitem:a58716b99c436fc5003aaf29aec0dfac6 inherit pro_attribs_class_socket"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a58716b99c436fc5003aaf29aec0dfac6"></a>
sint32&#160;</td><td class="memItemRight" valign="bottom"><b>m_sockfd</b></td></tr>
<tr class="separator:a58716b99c436fc5003aaf29aec0dfac6 inherit pro_attribs_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4a66dcf9fec7da8a9b1b83856fe66be inherit pro_attribs_class_socket"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae4a66dcf9fec7da8a9b1b83856fe66be"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><b>m_localAddr</b></td></tr>
<tr class="separator:ae4a66dcf9fec7da8a9b1b83856fe66be inherit pro_attribs_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a75ed54fdf1f77872e030720424d4ee1a inherit pro_attribs_class_socket"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a75ed54fdf1f77872e030720424d4ee1a"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><b>m_peerAddr</b></td></tr>
<tr class="separator:a75ed54fdf1f77872e030720424d4ee1a inherit pro_attribs_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16e04162da1d3f68516998af9e061999 inherit pro_attribs_class_socket"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a16e04162da1d3f68516998af9e061999"></a>
uint16&#160;</td><td class="memItemRight" valign="bottom"><b>m_localPort</b></td></tr>
<tr class="separator:a16e04162da1d3f68516998af9e061999 inherit pro_attribs_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba1561ea305405179f0b60a609248b97 inherit pro_attribs_class_socket"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aba1561ea305405179f0b60a609248b97"></a>
uint16&#160;</td><td class="memItemRight" valign="bottom"><b>m_peerPort</b></td></tr>
<tr class="separator:aba1561ea305405179f0b60a609248b97 inherit pro_attribs_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a352e7e79cc7c18ab10fec2e4ccc51b1d inherit pro_attribs_class_socket"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a352e7e79cc7c18ab10fec2e4ccc51b1d"></a>
struct sockaddr_in&#160;</td><td class="memItemRight" valign="bottom"><b>m_localSockAddr</b></td></tr>
<tr class="separator:a352e7e79cc7c18ab10fec2e4ccc51b1d inherit pro_attribs_class_socket"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_class_i_o_device"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_class_i_o_device')"><img src="closed.png" alt="-"/>&#160;Protected 属性 继承自 <a class="el" href="class_i_o_device.html">IODevice</a></td></tr>
<tr class="memitem:a5ab8e2aa83ad8a53d8ddbb19b23d3688 inherit pro_attribs_class_i_o_device"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5ab8e2aa83ad8a53d8ddbb19b23d3688"></a>
sint32&#160;</td><td class="memItemRight" valign="bottom"><b>m_fd</b></td></tr>
<tr class="separator:a5ab8e2aa83ad8a53d8ddbb19b23d3688 inherit pro_attribs_class_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4900690afb4b4d17f90cfe3a9fb504e inherit pro_attribs_class_i_o_device"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa4900690afb4b4d17f90cfe3a9fb504e"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><b>m_devName</b></td></tr>
<tr class="separator:aa4900690afb4b4d17f90cfe3a9fb504e inherit pro_attribs_class_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e930bf51c6a266e5be5b2ed62c7ecfa inherit pro_attribs_class_i_o_device"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5e930bf51c6a266e5be5b2ed62c7ecfa"></a>
sint32&#160;</td><td class="memItemRight" valign="bottom"><b>m_openMode</b></td></tr>
<tr class="separator:a5e930bf51c6a266e5be5b2ed62c7ecfa inherit pro_attribs_class_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>TcpSocket类 </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a class="anchor" id="a126ef6e4d23288de68432af73ec46cb1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 TcpSocket::acceptConnection </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_tcp_socket.html">TcpSocket</a> &amp;&#160;</td>
          <td class="paramname"><em>newsocket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>TCP socket接受连接 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">newsocket</td><td>接受的新连接 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a58d2fff73fb69eb3f18b00aca7d6c87a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 TcpSocket::close </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>关闭TCP socket </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

<p>重载 <a class="el" href="class_socket.html#a1fe4c90416cad39e96049019d178fb37">Socket</a> .</p>

</div>
</div>
<a class="anchor" id="a5470902009a68d3fd66c924eb33a6737"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 TcpSocket::connectToHost </td>
          <td>(</td>
          <td class="paramtype">uint16&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>ipaddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>TCP socket连接远端 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">port</td><td>对端端口 </td></tr>
    <tr><td class="paramname">ipaddr</td><td>对端IP地址 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回接收的数据长度,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

<p>重载 <a class="el" href="class_socket.html#abfbea049b117c0f4c91405b31b4694e4">Socket</a> .</p>

</div>
</div>
<a class="anchor" id="a5aa820cc351f24dada219b243e832bc0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 TcpSocket::listenConnection </td>
          <td>(</td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>maxpending</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>TCP socket监听连接 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">maxpend</td><td>最大挂起连接数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a5e0e69092165d6847478a27006b8a8c6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 TcpSocket::open </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>打开TCP socket </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

<p>实现了 <a class="el" href="class_socket.html">Socket</a>.</p>

</div>
</div>
<a class="anchor" id="a35fb1c8b1f5235bce6418a75252c136e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 TcpSocket::readData </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>timeoutMs</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>TCP socket接收数据 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>接收缓存 </td></tr>
    <tr><td class="paramname">len</td><td>缓存大小 </td></tr>
    <tr><td class="paramname">timeoutMs</td><td>超时时间,-1:阻塞,0:立即返回,&gt;0:超时时间ms </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回接收的数据长度,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

<p>实现了 <a class="el" href="class_socket.html">Socket</a>.</p>

</div>
</div>
<a class="anchor" id="a5f7504d2465e529139750cd36f794822"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 TcpSocket::writeData </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>timeoutMs</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>TCP socket发送数据 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>发送数据缓存 </td></tr>
    <tr><td class="paramname">len</td><td>缓存大小 </td></tr>
    <tr><td class="paramname">timeoutMs</td><td>超时时间,-1:阻塞,0:立即返回,&gt;0:超时时间ms </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回发送的数据长度,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

<p>实现了 <a class="el" href="class_socket.html">Socket</a>.</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>libemb/inc/<a class="el" href="_socket_8h_source.html">Socket.h</a></li>
<li>libemb/src/Socket.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2016年 七月 7日 星期四 19:49:39 , 为 embedme使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>
